
import {
	INIT_TASK_LIST,LIST_LOAD
} from '../constants/actionTypes';

const defaultState = {
	tasks:[],
	isLoad:false
};


export default (state = defaultState, action) => {
	const {type,payload} = action;
	var tempState = {...state};
	switch (type) {
		case LIST_LOAD:
			
			tempState.isLoad = true;
			return tempState;
			
		case INIT_TASK_LIST:
			tempState.tasks = payload.data
			return tempState;
		default:
			return state;
	}
};